home *** CD-ROM | disk | FTP | other *** search
- package assets.screens
- {
- import flash.display.*;
- import flash.events.*;
-
- [Embed(source="/_assets/assets.swf", symbol="assets.screens.screen_select")]
- public class screen_select extends MovieClip
- {
-
-
- private var scope:Object;
-
- public var character_mc:MovieClip;
-
- public var shirt_mc:MovieClip;
-
- public var course_mc:MovieClip;
-
- public var board_mc:MovieClip;
-
- private var pages:Array;
-
- public function screen_select(param1:*)
- {
- pages = new Array();
- super();
- scope = param1;
- addEventListener(Event.REMOVED_FROM_STAGE,onRemove);
- character_mc.nextCharBtn.addEventListener(MouseEvent.CLICK,nextChar);
- character_mc.selectCharBtn.addEventListener(MouseEvent.CLICK,selectChar);
- shirt_mc.nextShirtBtn.addEventListener(MouseEvent.CLICK,nextShirt);
- shirt_mc.selectShirtBtn.addEventListener(MouseEvent.CLICK,selectShirt);
- board_mc.nextDeckBtn.addEventListener(MouseEvent.CLICK,nextDeck);
- board_mc.nextWheelBtn.addEventListener(MouseEvent.CLICK,nextWheel);
- board_mc.selectBoardBtn.addEventListener(MouseEvent.CLICK,selectBoard);
- course_mc.nextCourseBtn.addEventListener(MouseEvent.CLICK,nextCourse);
- course_mc.selectCourseBtn.addEventListener(MouseEvent.CLICK,selectCourse);
- pages = [character_mc,shirt_mc,board_mc,course_mc];
- character_mc.charbox.gotoAndStop(1);
- shirt_mc.shirtbox.gotoAndStop(1);
- board_mc.boardbox.gotoAndStop(1);
- course_mc.coursebox.gotoAndStop(1);
- course_mc.coursebox.locked_mc.visible = false;
- pageManager(2);
- }
-
- private function locked() : *
- {
- trace("locked");
- }
-
- private function pageManager(param1:*) : *
- {
- var _loc2_:* = undefined;
- _loc2_ = 0;
- while(_loc2_ < pages.length)
- {
- pages[_loc2_].visible = false;
- _loc2_++;
- }
- switch(param1)
- {
- case 1:
- character_mc.visible = true;
- break;
- case 2:
- shirt_mc.visible = true;
- break;
- case 3:
- board_mc.visible = true;
- break;
- case 4:
- course_mc.visible = true;
- break;
- case 5:
- scope.setScreen(3);
- }
- }
-
- private function nextDeck(param1:MouseEvent) : *
- {
- if(board_mc.boardbox.deck.currentFrame < board_mc.boardbox.deck.totalFrames)
- {
- board_mc.boardbox.deck.nextFrame();
- }
- else
- {
- board_mc.boardbox.deck.gotoAndStop(1);
- }
- }
-
- private function selectCourse(param1:MouseEvent) : *
- {
- scope.course = course_mc.coursebox.currentFrame;
- if(scope["c" + course_mc.coursebox.currentFrame + "lock"])
- {
- locked();
- }
- else
- {
- pageManager(5);
- }
- }
-
- private function onRemove(param1:Event) : *
- {
- character_mc.nextCharBtn.removeEventListener(MouseEvent.CLICK,nextChar);
- character_mc.selectCharBtn.removeEventListener(MouseEvent.CLICK,selectChar);
- shirt_mc.nextShirtBtn.removeEventListener(MouseEvent.CLICK,nextShirt);
- shirt_mc.selectShirtBtn.removeEventListener(MouseEvent.CLICK,selectShirt);
- board_mc.nextDeckBtn.removeEventListener(MouseEvent.CLICK,nextDeck);
- board_mc.nextWheelBtn.removeEventListener(MouseEvent.CLICK,nextWheel);
- board_mc.selectBoardBtn.removeEventListener(MouseEvent.CLICK,selectBoard);
- course_mc.nextCourseBtn.removeEventListener(MouseEvent.CLICK,nextCourse);
- course_mc.selectCourseBtn.removeEventListener(MouseEvent.CLICK,selectCourse);
- removeEventListener(Event.REMOVED_FROM_STAGE,onRemove);
- }
-
- private function selectShirt(param1:MouseEvent) : *
- {
- scope.player.snum = shirt_mc.shirtbox.currentFrame;
- pageManager(3);
- }
-
- private function selectBoard(param1:MouseEvent) : *
- {
- scope.player.dnum = board_mc.boardbox.deck.currentFrame;
- scope.player.wnum = board_mc.boardbox.wheels.currentFrame;
- pageManager(4);
- }
-
- private function nextWheel(param1:MouseEvent) : *
- {
- if(board_mc.boardbox.wheels.currentFrame < board_mc.boardbox.wheels.totalFrames)
- {
- board_mc.boardbox.wheels.nextFrame();
- }
- else
- {
- board_mc.boardbox.wheels.gotoAndStop(1);
- }
- }
-
- private function selectChar(param1:MouseEvent) : *
- {
- scope.player.cnum = character_mc.charbox.currentFrame;
- pageManager(2);
- }
-
- private function nextShirt(param1:MouseEvent) : *
- {
- if(shirt_mc.shirtbox.currentFrame < shirt_mc.shirtbox.totalFrames)
- {
- shirt_mc.shirtbox.nextFrame();
- }
- else
- {
- shirt_mc.shirtbox.gotoAndStop(1);
- }
- }
-
- private function nextChar(param1:MouseEvent) : *
- {
- if(character_mc.charbox.currentFrame < character_mc.charbox.totalFrames)
- {
- character_mc.charbox.nextFrame();
- }
- else
- {
- character_mc.charbox.gotoAndStop(1);
- }
- }
-
- private function nextCourse(param1:MouseEvent) : *
- {
- if(course_mc.coursebox.currentFrame < course_mc.coursebox.totalFrames)
- {
- course_mc.coursebox.nextFrame();
- }
- else
- {
- course_mc.coursebox.gotoAndStop(1);
- }
- if(scope["c" + course_mc.coursebox.currentFrame + "lock"])
- {
- course_mc.coursebox.locked_mc.visible = true;
- }
- else
- {
- course_mc.coursebox.locked_mc.visible = false;
- }
- }
- }
- }
-